<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableForum extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('forums', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('版块名称');
            $table->string('icon')->nullable()->comment('图标');
            $table->text('description')->nullable()->comment('描述');
            $table->integer('topic_count')->default(0);
            $table->integer('comment_count')->default(0);
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `forums` AUTO_INCREMENT = 101, comment = '版块表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('forums');
    }
}
